/******************* 公共变量 *******************/
var contactType = core.getUrlData('contact'),
	shouId = core.getUrlData('shou_id');

/******************* 载入数据 *******************/
function getData() {
	$.ajax({
		url: ((contactType == 'follow') ? getFollow : getFans),
		type: 'post',
		// data: {user_id: '1'},
		success: function (data) {
			console.log(data)
			vm.list = data.list;
		}
	});
}

/******************* Vue *******************/
var vm = new Vue({
	el: '.wrap',
	data: {
		type: contactType,
		userDetailUrl: userDetailUrl,
		activityChatUrl: activityChatUrl,
		shouId: shouId,
		list: []
	},
	methods: {
		focus: function (is_friend, user_id) {
			console.log(is_friend, user_id)
			console.log((contactType == 'follow') ? noFocusUrl : ((is_friend == 1) ? noFocusUrl : focusUrl))
			$.ajax({
				url: (contactType == 'follow') ? noFocusUrl : ((is_friend == 1) ? noFocusUrl : focusUrl),
				type: 'post',
				data: {fo_user_id: user_id},
				success: function(data) {
					console.log(data);
					core.layerHint(data.message);
					getData();
				}
			});
		},
		getHeader: function (image) {
			core.ls('userOtherImage', 's', image);
		}
	},
	computed: {
		
	},
	components: {
		
	},
	created: function () {
		getData();
	},
	mounted: function () {
		$('html body .header-title h1, title').html((contactType == 'follow') ? '我的关注' : '我的粉丝');
	},
	updated: function () {
		
	}
});
